/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2023-11-24 15:38:32
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2023-11-24 16:06:43
 * @FilePath: \WingsUpdater-main\inc\Rand.hpp
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

#pragma once
#include <random>
#include <limits>

template<typename T>
T random()
{
    static std::random_device rd;
    static std::default_random_engine generator(rd());
    static std::uniform_int_distribution<T> distributor(std::numeric_limits<T>::min(), std::numeric_limits<T>::max());

    return distributor(generator);
}

template<typename T>
T randomRange(T min, T max)
{
    static std::random_device rd;
    static std::default_random_engine generator(rd());
    static std::uniform_int_distribution<T> distributor(min, max);

    return distributor(generator);
}
